<!-- 账户信息 -->
<template>
  <div class="account-information-dialog">
    <el-dialog
      :append-to-body="true"
      width="650px"
      class="ypt-dialog"
      title="账号信息"
      :visible="myVisible"
      @close="close">
      <el-form label-width="80px">
        <el-form-item label="用户名">
          {{ userForm.NickName }}
        </el-form-item>
        <el-form-item label="姓名">
          {{ userForm.FullName }}
        </el-form-item>
        <el-form-item label="联系方式">
          {{ userForm.Mobile1}}
        </el-form-item>
        <el-form-item label="QQ">
          {{ userForm.QQ }}
        </el-form-item>
        <el-form-item label="公司">
          {{ userForm.CompanyName }}
        </el-form-item>
        <el-form-item label="地址">
          {{ userForm.Address }}
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="close">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  getUserInfo
} from '../api/loginApi'
export default {
  data () {
    return {
      userForm: {},
      comment: {},
      isMyself: false,
      phones: [],
      myVisible: this.visible
    }
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    visible (value) {
      this.myVisible = value
      this.getUser()
    },
    myVisible (value) {
      this.$emit('visibleChange', value)
    }
  },
  methods: {
    async getUser () {
      let res = await getUserInfo({})
      this.userForm = res.data[0]
    },
    close () {
      this.myVisible = false
    },
    openLookEvaluationDialog () {
      this.$store.state.lookEvaluation = {
        visible: true,
        data: this.userForm
      }
    }
  }
}
</script>

<style lang="less">
  .account-information-dialog{
    .evaluation-wrap{
      display: inline-block;
      .look-evaluation{
        padding: 3px 8px;
      }
    }
  }
</style>
